package com.leetcode.partition9;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author `RKC`
 * @date 2022/1/30 16:38
 */
public class LC884两句话中的不常见单词 {

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String s1 = reader.readLine(), s2 = reader.readLine();
        String[] answer = uncommonFromSentences(s1, s2);
        for (String ans : answer) writer.write(ans + "\n");
        writer.flush();
    }

    public static String[] uncommonFromSentences(String s1, String s2) {
        String[] ss1 = s1.split(" "), ss2 = s2.split(" ");
        Map<String, Integer> cnt = new HashMap<>();
        List<String> ans = new ArrayList<>();
        for (String s : ss1) cnt.put(s, cnt.getOrDefault(s, 0) + 1);
        for (String s : ss2) cnt.put(s, cnt.getOrDefault(s, 0) + 1);
        for (Map.Entry<String, Integer> entry : cnt.entrySet()) {
            if (entry.getValue() == 1) ans.add(entry.getKey());
        }
        return ans.toArray(new String[ans.size()]);
    }
}
